package com.ccjq.jq167.student.service.impl;

import com.ccjq.jq167.student.dao.StudentDao;
import com.ccjq.jq167.student.dao.impl.StudentDaoImpl;
import com.ccjq.jq167.student.domain.StudentPo;
import com.ccjq.jq167.student.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    //查询个人
    public List<StudentPo> selectInfo(String name) {
        StudentDao studentDao=new StudentDaoImpl();
        List<StudentPo> list=studentDao.selectInfo(name);
        return list;
    }

    //通过id查询个人
    public StudentPo getInfo(String id) {
        StudentDao studentDao=new StudentDaoImpl();
        StudentPo student=studentDao.getInfo(id);
        return student;
    }

    //添加
    public boolean insert(StudentPo studentPo) {
        StudentDao studentDao=new StudentDaoImpl();
        boolean b=studentDao.insert(studentPo);
        return b;
    }

    //删除
    public boolean delete(StudentPo studentPo) {
        StudentDao studentDao=new StudentDaoImpl();
        boolean b=studentDao.delete(studentPo);
        return b;
    }

    //修改
    public boolean update(StudentPo studentPo) {
        StudentDao studentDao=new StudentDaoImpl();
        boolean b=studentDao.update(studentPo);
        return b;
    }
}
